<?php


echo htmlspecialchars($_POST['username']);

if(isset($_POST['tel'])){
    if(empty($_POST['tel'])){
        $tel="-";
    }else{
        $tel=trim($_POST['tel']);
    }
}else{
    $tel="-";
}
echo htmlspecialchars($_POST['sex']);
echo htmlspecialchars($_POST['idno1']);
echo htmlspecialchars($_POST['tel']);
echo htmlspecialchars($_POST['pay1']);
echo htmlspecialchars($_POST['pay2']);
/*是代收费 汇总*/
echo htmlspecialchars($_POST['pay3']);

/*是学费 住宿费 汇总*/
echo htmlspecialchars($_POST['pay4']);
echo htmlspecialchars($_POST['aa']);

//注释：
//工商学校只有学费，住宿费，教材费，学费pay1 ,住宿费pay2 ,教材费pay9 ,
//教材费  pay3=pay9
//学费住宿费 pay4=pay1+pay2+pay9
// 只可能用pay4
//$ajsonObj = '{"input1":"143781","input2":"测试","input3":"15307968235","input4":"100"}';
//$str = '{"a":"123","b":"456"}';
//$jsonObj = '[{"input1":"143781","input2":"测试","input3":"15307968235","input4":"100"}]';
////首先要用 json_decode 对 JSON 格式的字符串进行编码，
//
//$datajson = json_decode($jsonObj);
//$datajson[0]->input4=htmlspecialchars($_POST['orderAmount2']);
//外国语链接
$_POST['username']=trim($_POST['username']);
//$tel=isset($_POST['tel']) ? $_POST['tel'] : '-';
$_POST['aa']='A';
if (htmlspecialchars($_POST['aa'])=='A'){
    $_POST['aa']='学费类';
    if(htmlspecialchars($_POST['pay3'])==0){
        /*如果代收费是0元，那么交了学费住宿费就是交齐*/

        $url = "https://enjoy.abchina.com/jf-web/epayItem?code=JF-EPAY2021082332174&userInput=%7B%22input1%22%3A%22".htmlspecialchars($_POST['username'])."%22%2C%22input2%22%3A%22".htmlspecialchars($_POST['idno1'])."%22%2C%22input3%22%3A%22".htmlspecialchars($tel)."%22%2C%22input4%22%3A%22".htmlspecialchars($_POST['pay4'])."%22%2C%22input5%22%3A%22".htmlspecialchars($_POST['aa'])."%22%7D&showBill=1";
    }else{
        $url = "https://enjoy.abchina.com/jf-web/epayItem?code=JF-EPAY2021082332174&userInput=%7B%22input1%22%3A%22".htmlspecialchars($_POST['username'])."%22%2C%22input2%22%3A%22".htmlspecialchars($_POST['idno1'])."%22%2C%22input3%22%3A%22".htmlspecialchars($tel)."%22%2C%22input4%22%3A%22".htmlspecialchars($_POST['pay4'])."%22%2C%22input5%22%3A%22".htmlspecialchars($_POST['aa'])."%22%7D&showBill=1";
    }
}else{
    $_POST['aa']='学杂费';
    if(htmlspecialchars($_POST['pay4'])==0){
        /*如果代收费是0元，那么交了学费住宿费就是交齐*/
      $_POST['aa']='学杂费类';
        $url = "https://enjoy.abchina.com/jf-web/epayItem?code=JF-EPAY2021082332174&userInput=%7B%22input1%22%3A%22".htmlspecialchars($_POST['username'])."%22%2C%22input2%22%3A%22".htmlspecialchars($_POST['idno1'])."%22%2C%22input3%22%3A%22".htmlspecialchars($tel)."%22%2C%22input4%22%3A%22".htmlspecialchars($_POST['pay3'])."%22%2C%22input5%22%3A%22".htmlspecialchars($_POST['aa'])."%22%7D&showBill=1";

    }else{
        $url = "https://enjoy.abchina.com/jf-web/epayItem?code=JF-EPAY2021082332174&userInput=%7B%22input1%22%3A%22".htmlspecialchars($_POST['username'])."%22%2C%22input2%22%3A%22".htmlspecialchars($_POST['idno1'])."%22%2C%22input3%22%3A%22".htmlspecialchars($tel)."%22%2C%22input4%22%3A%22".htmlspecialchars($_POST['pay3'])."%22%2C%22input5%22%3A%22".htmlspecialchars($_POST['aa'])."%22%7D&showBill=1";

    }

}

//博望链接


//$url = "https://enjoy.abchina.com/jf-web/epayItem?code=JF-EPAY2021070619659&userInput=%7B%22input1%22%3A%22%E5%8D%97%E6%98%8C%22%2C%22input2%22%3A%22320%22%2C%22input3%22%3A%22138%22%2C%22input4%22%3A%221%22%7D&showBill=0";
//$url = "https://enjoy.abchina.com/jf-web/epayItem?code=JF-EPAY2021021974667&userInput=%7B%22input1%22%3A%22".htmlspecialchars($_POST['clientType'])."%22%2C%22input2%22%3A%22%E6%B5%8B%E8%AF%95%22%2C%22input3%22%3A%2215307968235%22%2C%22input4%22%3A%2220%22%7D&showBill=2";
Header("Location:$url");
//function console_log($data)  //调试输出用函数
//{
//    if (is_array($data) || is_object($data))
//    {
//        echo("<script>console.log(".json_encode($data).");</script>");
//    }
//    else
//    {
//        echo("<script>console.log(".$data.");</script>");
//    }
//}
?>